package com.itheima.health.security;

public class SecurityContext {
    private static final ThreadLocal<SecurityUser> SECURITY_USER_THREAD_LOCAL=new ThreadLocal<>();
    //设置ThreadLocal的value值
    public static void setSecurityUserThreadLocal(SecurityUser securityUser){
        SECURITY_USER_THREAD_LOCAL.set(securityUser);
    }
    //获取ThreadLocal的value值
    public static SecurityUser getSecurityUserThreadLocal(){
        return SECURITY_USER_THREAD_LOCAL.get();
    }
    //删除ThreadLocal的value值
    public static void removeSecurityUserThreadLocal(){
        SECURITY_USER_THREAD_LOCAL.remove();
    }
}
